home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group93c.txt
/
000068_icon-group-sender _Sat Oct 2 13:49:27 1993.msg
< prev
next >
Wrap
Internet Message Format
|
1994-02-02
|
2KB
Received: by cheltenham.cs.arizona.edu; Thu, 7 Oct 1993 08:41:16 MST
Date: 2 Oct 93 13:49:27 GMT
From: cis.ohio-state.edu!magnus.acs.ohio-state.edu!math.ohio-state.edu!wupost!tulane!cs.cs.uno.edu!uno.edu!KGPL@ucbvax.Berkeley.EDU
Organization: University of New Orleans
Subject: Self-Extending/Modifying Code
Message-Id: <1993Oct2.134927.4078@cs.uno.edu>
Sender: icon-group-request@cs.arizona.edu
To: icon-group@cs.arizona.edu
Status: R
Errors-To: icon-group-errors@cs.arizona.edu
Can one write code in Icon that extends or modifies itself during
run-time? It has been suggested to me that this can be done, but
after reading/browsing (depending on the chapter) the 1990 edition
of the Griswolds' book, I can find no way to do this. Admittedly
I can use the "create" command to do something like this, but only
if I write the code that I wish to add myself.
What I would like to do is something like this... Imagine a procedure
that randomly generates legal icon procedures. Procedures that do not
appear anywhere in the code currently being run. I would like to be
able to generate a totally new procedure, store it as a string (or
whatever is appropriate) in a variable, and then jump command to that
string/program just created. All of this during run-time. Something
like:
my_program := random_code()
my_program()
Ideally, there should be a way to get the origional code to make
changes to itself, as well. However this is too much to hope for.
Any help would be appreciated.
kgpl@jazz.ucc.uno.edu